<template>
  <div>
    <!-- 底部部分 -->
    <footer class="footer">
      <span class="todo-count"><strong>{{sum}}</strong>剩余</span>
      <ul class="filters">
        <li>
          <a class="selected" href="#/" @click="selectList('all')">全部</a>
        </li>
        <li>
          <a href="#/active" @click="selectList('active')">进行中</a>
        </li>
        <li>
          <a href="#/completed" @click="selectList('completed')">已完成</a>
        </li>
      </ul>
      <button class="clear-completed" v-show="show" @click.prevent="clearList">清除已完成</button>
    </footer>
  </div>
</template>

<script>
export default {
  props: {
    show: {
      type: Boolean,
      required: true,
    },
    sum:{
      type:Number,
      required:true,
    },
    type:{
      type:String,
      required:true,
    }
  },
  methods:{
    clearList(){
      this.$emit('clearList')
    },
    selectList(type){
      this.$emit('selectList',type)
    }
  }
}
</script>

<style></style>
